﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">

<class name="Parichay.Domain.MemberMessage, Parichay.Domain" table="member_messages" >

<id name="Id" column="MessageId" type="System.Int32" unsaved-value="null"><generator class="native"/></id>

<property name="Privacy" column="Privacy" access="field.pascalcase-underscore" not-null="true" type="System.Int32"  insert="true" update="true"/>
<property name="Targeturl" column="TargetUrl" access="field.pascalcase-underscore" not-null="false" type="System.String"  insert="true" update="true"/>
<property name="Createdon" column="CreatedOn" access="field.pascalcase-underscore" not-null="true" type="System.DateTime"  insert="true" update="true"/>
<property name="Modifiedon" column="ModifiedOn" access="field.pascalcase-underscore" not-null="true" type="System.DateTime"  insert="true" update="true"/>
<property name="Type" column="Type" access="field.pascalcase-underscore" not-null="true" type="System.Int32"  insert="true" update="true"/>
<property name="Source" column="Source" access="field.pascalcase-underscore" not-null="true" type="System.String"  insert="true" update="true"/>
<property name="Text" column="Text" access="field.pascalcase-underscore" not-null="true" type="System.String"  insert="true" update="true"/>
<property name="Thumbnailfilename" column="ThumbnailFilename" access="field.pascalcase-underscore" not-null="false" type="System.String"  insert="true" update="true"/>
  <!--<property name="RecipientId" column="RecipientId" access="field.pascalcase-underscore" not-null="true" type="System.Int32"  insert="true" update="true"/>
  <property name="SenderId" column="SenderId" access="field.pascalcase-underscore" not-null="true" type="System.Int32"  insert="true" update="true"/>
  <property name="GroupId" column="GroupId" access="field.pascalcase-underscore" not-null="true" type="System.Int32"  insert="true" update="true"/>-->
  <many-to-one name="Message"  access="field.pascalcase-underscore" not-null="true" outer-join="auto" insert="false" update="false">
    <column name="MessageId"/>
  </many-to-one>
  <many-to-one name="Sender"  access="field.pascalcase-underscore" not-null="true" outer-join="auto" insert="true" update="true">
    <column name="SenderId"/>
  </many-to-one>
  <many-to-one name="Recipient"  access="field.pascalcase-underscore" not-null="true" outer-join="auto" insert="true" update="true">
    <column name="RecipientId"/>
  </many-to-one>
  <many-to-one name="ParentId" access="field.pascalcase-underscore" not-null="false" not-found="ignore"  update="true" insert="true">
    <column name="ParentId"></column>
  </many-to-one>
  <set name="Children" cascade="all-delete-orphan"
  inverse="true" access="field.pascalcase-underscore">
    <key column="ParentId"/>
    <one-to-many class="Parichay.Domain.MemberMessage, Parichay.Domain" not-found="ignore" />
  </set>
</class>
</hibernate-mapping>
